package com.microservice.salmon.oauth.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.DefaultSecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.stereotype.Component;

import javax.servlet.Filter;

/**
 * <p>
 *
 * </p>
 *
 * @author 王洪庆 2019-01-10 23:48
 */
@Component
public class ClientCheckConfig extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {

    @Autowired
    private Filter clientCheckFilter;

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.addFilterBefore(clientCheckFilter, UsernamePasswordAuthenticationFilter.class);
    }
}
